home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / ABox info... / About the ABox... / Programming Info / 3-Special Properties < prev    next >
Encoding:
Text File  |  1995-01-12  |  11.8 KB  |  294 lines  |  [TEXT/R*ch]

  1. Programming Info: Special Properties
  2.  
  3. Extra Functionality
  4.  
  5.     The ABox can be configured as:
  6.     
  7.           • a normal, modal about-box
  8.           • a moveable modal about-box
  9.           • a modeless about-box
  10.     
  11.     and, additionally, can be implemented as a modal, moveable modal, or
  12.     modeless splash screen that:
  13.       
  14.           • disappears upon mouse/key click
  15.           • disappears after a specific time
  16.           • disappears when the application tells it to
  17.     
  18.     When operating as a splash-screen, the ABox cannot be browsed. That
  19.     is, the user cannot scroll through the topics, move from slide to
  20.     slide, etc. Depending upon the configuration of the ABox (as specified
  21.     by the host application), the user might be able to drag items from
  22.     the ABox window, click on titles to hear the Speech Manager, move the
  23.     window about the desktop, or move between application layers.
  24.     Programmers take note: use a configuration that makes the most sense
  25.     for your application and implementation of the ABox--sometimes
  26.     modeless splash-screens might not be a good thing.
  27.  
  28. ============
  29.  
  30. More Details: Properties
  31.  
  32.     Properties are the driving customization mechanism behind all of the
  33.     ABox features. Borrowed from the model set forth by the PlainTalk and
  34.     Text-to-Speech subsystems of the MacOS, it provides a very small and
  35.     simple API for controlling the behavior of the software.
  36.  
  37.     The ABox class, which is what your application/code interacts with,
  38.     provides a pair of methods to get and set the various properties of 
  39.     the ABox. 
  40.         
  41.     OSErr ABox::GetProperty (ABProperty prop, void *ptr, long *ptrSize);
  42.     OSErr ABox::SetProperty (ABProperty prop, void *ptr, long ptrSize);
  43.             
  44.     The list of properties is provided in the ABox.h file; the code
  45.     fragment below is an example of how to setup some of the various
  46.     
  47.     There are several special error codes that the GetProperty/SetProperty
  48.     methods can return to your code; these are listed below:
  49.     
  50.     Error Code                Description
  51.     ------------------------------------------------------------------------
  52.     kABPropertyUnknown        the named property cannot be found within the
  53.                             ABox; be sure to use only the predefined
  54.                             property name constants, provided in the list
  55.                             found within this documentation
  56.                             
  57.     kABPropertyBadStorage    the property value could not be stored for your
  58.                             use. This typically happens when a dynamic
  59.                             memory allocation fails and the ABox code
  60.                             has to abort the property operation; it can also
  61.                             occur when the calling code provides inadequate
  62.                             storage (such as indicating that the return-value
  63.                             buffer has a negative length).
  64.                             
  65.     kABPropertyNullStorage    the property could not be returned to the calling
  66.                             code because no storage was provided for the return
  67.                             value.
  68.                             
  69.     kABPropertyReadOnly        the property that you attempted to adjust is a
  70.                             read-only value that cannot be altered. Read-Only
  71.                             properties are usually internal ABox properties
  72.                             that the caller is allowed to examine, but not
  73.                             alter.
  74.  
  75.     ==========================================================================
  76.  
  77.  
  78.  
  79.                     Named Property List
  80.                     
  81.     Every property has a name and a size constant, both of which are
  82.     provided to insulate you and your code from the actual implementation
  83.     of the property data whenever possible. You should always use the
  84.     predefined constants whenever possible, since the values "behind the
  85.     scenes" are always subject to change.
  86.                     
  87.     Property                    Description
  88.     ------------------------------------------------------------------------
  89.     kABoxWindow                    READ-ONLY
  90.     kABoxWindowSize                (sizeof(WindowPtr))
  91.  
  92.     kABoxHomeFolder
  93.     kABoxHomeFolderSize            The home folder property is used to "point"
  94.                                 the ABox at a folder tree. The property has a
  95.                                 default value corresponding to an invalid
  96.                                 FSSpec, thereby describing an invalid folder
  97.                                 tree. If you wish to provide a folder tree
  98.                                 for the ABox, set this property with an FSSpec
  99.                                 of your design.
  100.  
  101.     kABoxSplashTimeSeconds
  102.     kABoxSplashTimeSecondsSize    The splash time property is used to set the
  103.                                 splash-screen capabilities of the ABox. There
  104.                                 are several pre-defined splash-time values
  105.                                 available for your use (the default value
  106.                                 is kABoxNoSplash):
  107.                                 
  108.                                 kABoxNoSplash                    don't act as a splash screen
  109.                                                                 
  110.                                 kABoxWaitForClickSplash            splash screen
  111.                                                                 that needs a click or a
  112.                                                                 return-key-hit to be dismissed
  113.                                                                 
  114.                                 kABoxWaitForApplicationSplash    splash screen
  115.                                                                 dismissed by the application
  116.                                                                 and not by the user
  117.                                 
  118.                                 Additionally, any positive non-zero value can
  119.                                 be used as the value of the splash-time
  120.                                 property to indicate a splash screen that
  121.                                 exists for that many seconds.
  122.  
  123.     kABoxNumberOfTopics            READ-ONLY
  124.     kABoxNumberOfTopicsSize        The number of topics property represents the
  125.                                 total number of topics in the ABox. This value
  126.                                 includes the topics found within the application
  127.                                 resource fork and those found in the home folder
  128.                                 tree, if provided.
  129.  
  130.     kABoxFirstTopicNumber
  131.     kABoxFirstTopicNumberSize    This property is used to indicate to the ABox
  132.                                 which topic in the topic list should be the
  133.                                 'active topic' when the ABox is displayed.
  134.                                 The default value of 1 indicates the first 
  135.                                 topic in the list (traditionally the topic
  136.                                 found within the application resource fork, if
  137.                                 present). By changing this property you can
  138.                                 alter which topic the ABox will display first
  139.                                 when made visible, a useful feature for
  140.                                 context-sensitive operations.
  141.  
  142.     kABoxCurrentTopic            READ-ONLY
  143.     kABoxCurrentTopicSize        This property represents the currently selected
  144.                                 and shown (ie: highlighted and displayed) topic
  145.  
  146.     kABoxFirstSlideNumber        
  147.     kABoxFirstSlideNumberSize    This property is used to indicate to the ABox
  148.                                 which slide in the first-topic will be shown
  149.                                 when the ABox is displayed. The default value 
  150.                                 of 1 indicates the first slide of the first
  151.                                 topic in the list (traditionally the topic
  152.                                 found within the application resource fork, if
  153.                                 present). By changing this property you can
  154.                                 alter which slide of the first topic the ABox 
  155.                                 will display first when made visible, a useful 
  156.                                 feature for context-sensitive operations.
  157.  
  158.     kABoxAppResFile                
  159.     kABoxAppResFileSize            This property is used to inform the ABox
  160.                                 which resource fork belongs to the application.
  161.                                 Since the ABox deals with many files, supports 
  162.                                 the Thread Manager, and the application can
  163.                                 have many resource forks open, this property
  164.                                 is vitally important to the correct operation
  165.                                 of your programming. The default value is
  166.                                 that of the Toolbox call CurResFile() when the
  167.                                 ABox is first instantiated.
  168.  
  169.     kABoxUpdater                
  170.     kABoxUpdaterSize            This property is used by your programming to
  171.                                 provide a callback function for your application's
  172.                                 update methods when the ABox is up and running.
  173.                                 This is especially important when implementing
  174.                                 any form of modal ABox, since there are documented
  175.                                 issues with the functioning of the Dialog Manager
  176.                                 and update events for other windows/applications.
  177.                                 
  178.                                 You should set the property to a function/method
  179.                                 of your designs, being of type UpdateWindowUPP.
  180.                                 This method/function will be called whenever the
  181.                                 ABox needs to pass along an update event to your
  182.                                 code.
  183.  
  184.     kABoxModalIndicator            
  185.     kABoxModalIndicatorSize        This property is used to control whether the ABox
  186.                                 should behave as a modal, moveable modal, or
  187.                                 modeless window. The default is kABoxModal.
  188.                                 The predefined values for your use are:
  189.                                 
  190.                                 kABoxModal
  191.                                 kABoxMoveableModal
  192.                                 kABoxModeless
  193.  
  194.     kABoxAppNameAndVersion        
  195.     kABoxAppNameAndVersionSize    This property represents a string, provided by
  196.                                 your code, that can be used to display anything;
  197.                                 traditionally it is used to display the application
  198.                                 name and version, and perhaps date, in the
  199.                                 appropriate area of the ABox.
  200.  
  201.     kABoxTextFont                
  202.     kABoxTextFontSize            This property is used to control the font
  203.                                 used in the ABox. The property is of
  204.                                 type ABoxTextFontType, and has a default value
  205.                                 of kABtextFont.
  206.  
  207.     kABoxTextSize                
  208.     kABoxTextSizeSize            This property is used to control the font
  209.                                 size used in the ABox. The property is of
  210.                                 type ABoxTextSizeType, and has a default value
  211.                                 of kABtextSize.
  212.                                 
  213.     kABoxTextFace                
  214.     kABoxTextFaceSize            This property is used to control the font
  215.                                 style used in the ABox. The property is of
  216.                                 type ABoxTextFaceType, and has a default value
  217.                                 of kABtextFace.
  218.  
  219.     kABoxLastEvent                
  220.     kABoxLastEventSize            This property, odd as it is, allows access to
  221.                                 or the setting of the last EventRecord. This is
  222.                                 primarily an internally used property, and, as
  223.                                 a general rule, should not be used by your code.
  224.  
  225.     kABoxListHandle                READ-ONLY
  226.     kABoxListHandleSize            This property allows access to the list of topics
  227.                                 within the ABox.  This is primarily an internally 
  228.                                 used property, and, as a general rule, should not 
  229.                                 be used by your code.
  230.  
  231.     kABoxWindowTitle            
  232.     kABoxWindowTitleSize        This property represents a string to be used for
  233.                                 the title of the ABox window, seen only when
  234.                                 the ABox is implemented as a moveable modal or
  235.                                 modeless window.
  236.  
  237.     kABoxThreadsHandler            
  238.     kABoxThreadsHandlerSize        This property is used by your programming to
  239.                                 provide a thread function for your application
  240.                                 when Thread Manager support is provided.
  241.                                 
  242.                                 You should set the property to a function/method
  243.                                 of your designs, being of type DoThreadsUPP.
  244.                                 This method/function will be called whenever the
  245.                                 ABox needs to pass thread control to your code.
  246.  
  247.     kABoxInBackground            READ-ONLY
  248.     kABoxInBackgroundSize        This property can be used to determine if the
  249.                                 ABox is in the background.
  250.  
  251.     kABoxIsFinished                READ-ONLY
  252.     kABoxIsFinishedSize            This property can be used to determine if the
  253.                                 ABox is finished and should be dismantled, useful
  254.                                 only when implementing the ABox as a modeless
  255.                                 window.
  256.  
  257.     kABoxReportMemory            
  258.     kABoxReportMemorySize        This property is a boolean indicator that controls
  259.                                 whether the ABox should provide a memory usage
  260.                                 display in the corner of the ABox. This is useful
  261.                                 for debugging, or if you just want to load the
  262.                                 ABox window up with various technoid-geeky
  263.                                 details. The default is false.
  264.  
  265.     kABoxUseSpeechMgr            
  266.     kABoxUseSpeechMgrSize        This property is a boolean indicator that controls
  267.                                 whether the ABox should provide Speech Manager
  268.                                 support. If set to true, the ABox will allow
  269.                                 the Speech Manager to speak the slide title when
  270.                                 the user clicks on the that element. Additionally,
  271.                                 if your application is built with the symbol
  272.                                 SPEAK_ERROR set to 1, the ABox will attempt to
  273.                                 speak any errors that occur instead of just
  274.                                 beeping. The default is true if the Speech
  275.                                 Manager is present.
  276.  
  277.     kABoxUseDragMgr                
  278.     kABoxUseDragMgrSize            This property is a boolean indicator that controls
  279.                                 whether the ABox should provide Drag Manager
  280.                                 support. If set to true, the ABox will allow the
  281.                                 user to drag various TEXT and PICT elements from
  282.                                 the ABox window to other Drag Manager savvy
  283.                                 applications. The default is true if the Drag
  284.                                 Manager is present.
  285.  
  286.     kABoxUseSoundMgr            
  287.     kABoxUseSoundMgrSize        This property is a boolean indicator that controls
  288.                                 whether the ABox should provide Sound Manager 3
  289.                                 support. If set to true, the ABox will play all
  290.                                 sounds in an asynchronous and Sound Manager 3
  291.                                 compatible fashion. The default is true if the 
  292.                                 Sound Manager 3 is present.
  293.  
  294.